home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-07-11 | 21.1 KB | 928 lines | [TEXT/MPS ] |
- (*********************)
- (* methods for TItem *)
- (*********************)
- {$S ARes}
- PROCEDURE TItem.IItem(theCard: TCard; theName: str255);
-
- VAR
- theTextHandler: TTextHandler;
-
- BEGIN
- SELF.SetTheName(theName);
- fCard:= theCard;
- theTextHandler:= fCard.GetTextHandler;
- SELF.SetTextHandler(theTextHandler);
- END; {TItem.IItem}
-
- {$S ARes}
- PROCEDURE TItem.StripIllegalChars(VAR theStr: str255);
-
- VAR
- index: 0..255;
- legalChars: SET OF CHAR;
- done: boolean;
-
- BEGIN
- legalChars:= ['a'..'z', 'A'..'Z', '0'..'9', '_'];
- index:= 1;
- WHILE index < Length(theStr) DO
- BEGIN
- done:= false;
- WHILE (NOT (theStr[index] IN legalChars)) AND (NOT done) DO
- IF Length(theStr) < index THEN
- done:= true
- ELSE
- Delete(theStr, index, 1);
- index:= index + 1;
- END;
- END; {TItem.StripIllegalChars}
-
- {$S ARes}
- FUNCTION TItem.GetTheName: str255;
-
- BEGIN
- GetTheName:= fName;
- END; {TItem.GetTheName}
-
- {$S ARes}
- PROCEDURE TItem.SetTheName(theName: str255);
-
- BEGIN
- SELF.StripIllegalChars(theName);
- fName:= theName;
- SELF.CheckForPrefix;
- END; {TItem.SetTheName}
-
- {$S ARes}
- FUNCTION TItem.GetTheItem: str255;
-
- BEGIN
- GetTheItem:= SELF.GetTheName;
- END; {TItem.GetTheItem}
-
- {$S ARes}
- FUNCTION TItem.GetTheCard: TCard;
-
- BEGIN
- GetTheCard:= fCard;
- END; {TItem.GetTheCard}
-
- {$S ARes}
- FUNCTION TItem.GetTextHandler: TTextHandler;
-
- BEGIN
- GetTextHandler:= fTextHandler;
- END; {TItem.GetTheName}
-
- {$S ARes}
- PROCEDURE TItem.SetTextHandler(theTextHandler: TTextHandler);
-
- BEGIN
- fTextHandler:= theTextHandler;
- END; {TItem.SetTextHandler}
-
- {$S AWriteFile}
- FUNCTION TItem.ReturnBytes: LONGINT;
-
- BEGIN
- ReturnBytes:= kStringSize;
- END; {TItem.ReturnBytes}
-
- {$S AReadFile}
- PROCEDURE TItem.ReadTheItem(aRefNum: INTEGER; theCard: TCard);
-
- VAR
- theString: str255;
- itemSize: LONGINT;
-
- BEGIN
- itemSize:= kStringSize;
- FailOSErr(FSRead(aRefNum, ItemSize, @theString));
- SELF.IItem(theCard, theString);
- END; {TItem.ReadTheItem}
-
- {$S AWriteFile}
- PROCEDURE TItem.WriteTheItem(aRefNum: INTEGER);
-
- VAR
- itemSize: LONGINT;
- theString: str255;
-
- BEGIN
- itemSize:= kStringSize;
- theString:= SELF.GetTheItem;
- FailOSErr(FSWrite(aRefNum, itemSize, @theString));
- END; {TItem.WriteTheItem}
-
- {$S ARes}
- PROCEDURE TItem.WriteDeclaration(theTEView: TMyTEView);
-
- BEGIN
- END; {TItem.WriteDeclaration}
-
- {$S ARes}
- PROCEDURE TItem.CheckForPrefix;
-
- VAR
- currentPrefix: str255;
-
- BEGIN
- currentPrefix:= Copy(fName, 1, 1);
- IF (currentPrefix <> kClassPrefix) THEN
- Insert(kClassPrefix, fName, 1);
- END; {TFieldItem.CheckForPrefix}
-
- {$S AFields}
- PROCEDURE TItem.Fields(PROCEDURE DoToField(fieldName: Str255; fieldAddr: Ptr;
- fieldType: INTEGER)); OVERRIDE;
- BEGIN
- DoToField('TItem', NIL, bClass);
- DoToField('fName', @fName, bString);
- DoToField('fCard', @fCard, bString);
- DoToField('fTextHandler', @fTextHandler, bObject);
- INHERITED Fields(DoToField);
- END;
-
-
- (**************************)
- (* methods for TFieldItem *)
- (**************************)
- {$S ARes}
- PROCEDURE TFieldItem.IFieldItem(theCard: TCard; theName, theTypeStr: str255);
-
- BEGIN
- SELF.IItem(theCard, theName);
- SELF.SetItemType(theTypeStr);
- SELF.MakeGetNIL;
- SELF.MakeSetNIL;
- SELF.SetTheFieldsTypeConst;
- SELF.SetPassByAddress;
- END; {TFieldItem.IFieldItem}
-
- {$S ARes}
- FUNCTION TFieldItem.GetItemType: str255;
-
- BEGIN
- GetItemType:= fItemType;
- END; {TItem.GetItemType}
-
- {$S ARes}
- PROCEDURE TFieldItem.SetItemType(theItemType:str255);
-
- BEGIN
- SELF.StripIllegalChars(theItemType);
- fItemType:= theItemType;
- END; {TItem.SetItemType}
-
- {$S ARes}
- FUNCTION TFieldItem.GetTheItem: str255; OVERRIDE;
-
- BEGIN
- GetTheItem:= Concat(kFieldPrefix, INHERITED GetTheItem);
- END; {TFieldItem.GetTheItem}
-
- {$S ARes}
- FUNCTION TFieldItem.GetTheFieldStr: str255;
-
- BEGIN
- GetTheFieldStr:= SELF.GetTheItem;
- END; {TFieldItem.GetTheFieldStr}
-
- {$S ARes}
- PROCEDURE TFieldItem.SetTheFieldsTypeConst;
- BEGIN
- fFieldsTypeConst:=SELF.GetTextHandler.ReturnFieldsTypeConst(SELF);
- END; {TFieldItem.SetTheFieldStr}
-
- {$S ARes}
- PROCEDURE TFieldItem.SetPassByAddress;
- BEGIN
- fPassByAddress:=SELF.GetTextHandler.ReturnByAddress(SELF);
- END; {TFieldItem.SetPassByAddress}
-
- {$S ARes}
- FUNCTION TFieldItem.GetPassByAddress: BOOLEAN;
- BEGIN
- GetPassByAddress:=fPassByAddress;
- END; {TFieldItem.GetPassByAddress}
-
- {$S ARes}
- FUNCTION TFieldItem.GetTheFieldsTypeConst;
- BEGIN
- GetTheFieldsTypeConst:=fFieldsTypeConst;
- END; {TFieldItem.SetTheFieldStr}
-
- {$S ARes}
- PROCEDURE TFieldItem.GetAccessors(VAR theGetter: TGetAccessorItem;
- VAR theSetter: TSetAccessorItem);
-
- BEGIN
- theGetter:= fGetAccessor;
- theSetter:= fSetAccessor;
- END; {TFieldItem.GetAccessors}
-
- {$S ARes}
- PROCEDURE TFieldItem.SetGetAccessor(theGetter: TGetAccessorItem);
-
- BEGIN
- fGetAccessor:= theGetter;
- END; {TFieldItem.SetGetAccessor}
-
- {$S ARes}
- PROCEDURE TFieldItem.SetSetAccessor(theSetter: TSetAccessorItem);
-
- BEGIN
- fSetAccessor:= theSetter;
- END; {TFieldItem.SetSetAccessor}
-
- {$S ARes}
- PROCEDURE TFieldItem.MakeGetNIL;
-
- BEGIN
- fGetAccessor:= NIL;
- END; {TFieldItem.MakeGetNIL}
-
- {$S ARes}
- PROCEDURE TFieldItem.MakeSetNIL;
-
- BEGIN
- fSetAccessor:= NIL;
- END; {TFieldItem.MakeGetNIL.}
-
- {$S ARes}
- FUNCTION TFieldItem.GetTheDeclaration: str255;
-
- VAR
- theDeclarationStr: str255;
-
- BEGIN
- GetTheDeclaration:=fTextHandler.GetFieldItemDeclaration(SELF);
- END; {TFieldItem.GetTheDeclaration}
-
- {$S ARes}
- FUNCTION TFieldItem.GetTheImplDeclaration: str255;
-
- VAR
- theDeclarationStr: str255;
-
- BEGIN
- GetTheImplDeclaration:=fTextHandler.GetFieldItemImplDeclaration(SELF);
- END; {TFieldItem.GetTheImplDeclaration}
-
- {$S ARes}
- PROCEDURE TFieldItem.WriteDeclaration(theTEView: TMyTEView); OVERRIDE;
-
- VAR
- theDeclarationStr: str255;
-
- BEGIN
- theDeclarationStr:=SELF.GetTheDeclaration;
- fTextHandler.Replace(theDeclarationStr, '^VOID', 'void');
- theTEView.WriteToMyTEView(theDeclarationStr);
- theTEView.WriteEndOfLine;
- END; {TFieldItem.WriteDeclaration}
-
- {$S ARes}
- PROCEDURE TFieldItem.CheckForPrefix; OVERRIDE;
-
- VAR
- currentPrefix: str255;
-
- BEGIN
- currentPrefix:= Copy(fName, 1, 1);
- IF (currentPrefix = kFieldPrefix) THEN
- Delete(fName, 1, 1);
- END; {TFieldItem.CheckForPrefix}
-
- {$S ARes}
- FUNCTION TMethodItem.GetNumRealMethods: integer;
-
- BEGIN
- GetNumRealMethods:= 1; {count me, I'm real.}
- END; {TMethodItem.GetNumRealMethods}
-
- {$S AWriteFile}
- FUNCTION TFieldItem.ReturnBytes: LONGINT; OVERRIDE;
-
- BEGIN
- ReturnBytes:= 2 * kStringSize;
- END; {TFieldItem.ReturnBytes}
-
- {$S AReadFile}
- PROCEDURE TFieldItem.ReadTheItem(aRefNum: INTEGER; theCard: TCard); OVERRIDE;
-
- VAR
- theName,
- theType: str255;
- itemSize: LONGINT;
-
- BEGIN
- itemSize:= kStringSize;
- FailOSErr(FSRead(aRefNum, ItemSize, @theName));
- FailOSErr(FSRead(aRefNum, ItemSize, @theType));
- SELF.IFieldItem(theCard, theName, theType);
- END; {TFieldItem.ReadTheItem}
-
- {$S AWriteFile}
- PROCEDURE TFieldItem.WriteTheItem(aRefNum: INTEGER); OVERRIDE;
-
- VAR
- itemSize: LONGINT;
- theString: str255;
-
- BEGIN
- itemSize:= kStringSize;
- theString:= SELF.GetTheName;
- FailOSErr(FSWrite(aRefNum, itemSize, @theString));
- FailOSErr(FSWrite(aRefNum, itemSize, @fItemType));
- END; {TFieldItem.WriteTheItem}
-
- {$S AFields}
- PROCEDURE TFieldItem.Fields(PROCEDURE DoToField(fieldName: Str255; fieldAddr: Ptr;
- fieldType: INTEGER)); OVERRIDE;
-
- BEGIN
- DoToField('TFieldItem', NIL, bClass);
- DoToField('fItemType', @fItemType, bString);
- DoToField('fGetAccessor', @fGetAccessor, bObject);
- DoToField('fSetAccessor', @fSetAccessor, bObject);
- DoToField('fFieldsTypeConst', @fFieldsTypeConst, bString);
- DoToField('fPassByAddress', @fPassByAddress, bBoolean);
- INHERITED Fields(DoToField);
- END; {TFieldItem.Fields}
-
-
- (***************************)
- (* methods for TMethodItem *)
- (***************************)
- {$S ARes}
- FUNCTION TMethodItem.GetOVERRIDE: boolean;
-
- BEGIN
- GetOVERRIDE:= fOVERRIDE;
- END; {TMethodItem.GetOVERRIDE}
-
- {$S ARes}
- PROCEDURE TMethodItem.SetOVERRIDE(overrideIt: boolean);
-
- BEGIN
- fOVERRIDE:= overrideIt;
- END; {TMethodItem.GetOVERRIDE}
-
- {$S ARes}
- PROCEDURE TMethodItem.IMethodItem(theCard: TCard; theName: str255; makeItOVERRIDE: boolean);
-
- BEGIN
- SELF.SetOVERRIDE(makeItOVERRIDE);
- SELF.IItem(theCard, theName);
- END; {TMethodItem.IMethodItem}
-
- {$S AWriteFile}
- FUNCTION TMethodItem.ReturnBytes: LONGINT; OVERRIDE;
-
- BEGIN
- ReturnBytes:= kStringSize + SIZEOF(boolean);
- END; {TMethodItem.ReturnBytes}
-
- {$S AReadFile}
- PROCEDURE TMethodItem.ReadTheItem(aRefNum: INTEGER; theCard: TCard); OVERRIDE;
-
- VAR
- theString: str255;
- isOVERRIDE: boolean;
- itemSize: LONGINT;
-
- BEGIN
- itemSize:= kStringSize;
- FailOSErr(FSRead(aRefNum, ItemSize, @theString));
- itemSize:= SIZEOF(boolean);
- FailOSErr(FSRead(aRefNum, ItemSize, @isOVERRIDE));
- SELF.IMethodItem(theCard, theString, isOVERRIDE);
- END; {TMethodItem.ReadTheItem}
-
- {$S AWriteFile}
- PROCEDURE TMethodItem.WriteTheItem(aRefNum: INTEGER); OVERRIDE;
-
- VAR
- itemSize: LONGINT;
- theString: str255;
- isOVERRIDE: boolean;
-
- BEGIN
- itemSize:= kStringSize;
- theString:= SELF.GetTheItem;
- FailOSErr(FSWrite(aRefNum, itemSize, @theString));
- itemSize:= SIZEOF(boolean);
- isOVERRIDE:= SELF.GetOVERRIDE;
- FailOSErr(FSWrite(aRefNum, itemSize, @isOVERRIDE));
- END; {TMethodItem.WriteTheItem}
-
- {$S ARes}
- FUNCTION TMethodItem.GetTheCodeLine: str255;
- BEGIN
- GetTheCodeLine:='Big ERROR';
- END;
-
- {$S ARes}
- PROCEDURE TMethodItem.WriteDeclaration(theTEView: TMyTEView); OVERRIDE;
-
- VAR
- theDeclarationStr: str255;
-
- BEGIN
- theDeclarationStr:=SELF.GetTheDeclaration;
- theTEView.WriteToMyTEView(theDeclarationStr);
- END; {TMethodItem.WriteDeclaration}
-
- {$S ARes}
- PROCEDURE TMethodItem.CheckForPrefix; OVERRIDE;
-
- BEGIN
- {DO NOTHING: let the names of the methods be whatever the user wants}
- END; {TMethodItem.CheckForPrefix}
-
- {$S ARes}
- FUNCTION TMethodItem.GetTheDeclaration: str255;
-
- VAR
- theClass: TItem;
- theClassName: str255;
-
- BEGIN
- theClass:= fCard.GetTheClass;
- theClassName:= theClass.GetTheItem;
- IF fOVERRIDE THEN
- GetTheDeclaration:= fTextHandler.GetOverrideMethStr(SELF)
- ELSE
- GetTheDeclaration:= fTextHandler.GetStdMethStr(SELF);
- END; {TMethodItem.GetTheDeclaration}
-
- {$S ARes}
- FUNCTION TMethodItem.GetTheImplDeclaration: str255;
-
- VAR
- theClass: TItem;
- theClassName: str255;
-
- BEGIN
- theClass:= fCard.GetTheClass;
- theClassName:= theClass.GetTheItem;
- IF fOVERRIDE THEN
- GetTheImplDeclaration:= fTextHandler.GetOverrideImplMethStr(SELF)
- ELSE
- GetTheImplDeclaration:= fTextHandler.GetStdImplMethStr(SELF);
- END; {TMethodItem.GetTheImplDeclaration}
-
- {$S ARes}
- PROCEDURE TMethodItem.WriteInlineProcedures(theTEView: TMyTEView);
- BEGIN {NOTE:Normal methods have no Inline definitions}
- END;
-
- {$S ARes}
- PROCEDURE TMethodItem.WriteImplementation(theTEView: TMyTEView);
-
- BEGIN
- theTEView.WriteToMyTEView(fTextHandler.GetStdMethodImplementationStr(SELF));
- END; {TMethodItem.WriteImplementation}
-
- {$S ARes}
- PROCEDURE TMethodItem.StripIllegalChars(VAR theStr: str255); OVERRIDE;
-
- VAR
- numbers: SET OF CHAR;
-
- BEGIN
- INHERITED StripIllegalChars(theStr);
- numbers:= ['0'..'9'];
- WHILE theStr[1] IN numbers DO
- Delete(theStr,1,1);
- END; {TMethodItem.StripIllegalChars}
-
- {$S AFields}
- PROCEDURE TMethodItem.Fields(PROCEDURE DoToField(fieldName: Str255; fieldAddr: Ptr;
- fieldType: INTEGER)); OVERRIDE;
-
- BEGIN
- DoToField('TMethodItem', NIL, bClass);
- DoToField('fOVERRIDE', @fOVERRIDE, bBoolean);
- INHERITED Fields(DoToField);
- END; {TMethodItem.Fields}
-
- (*********************************)
- (* methods for TFieldsMethodItem *)
- (*********************************)
-
- {$S ARes}
- FUNCTION TFieldsMethodItem.GetTheDeclaration: str255; OVERRIDE;
-
- BEGIN
- GetTheDeclaration:= fTextHandler.GetFieldsMethodDecStr(SELF);
- END; {TFieldsMethodItem.GetTheDeclaration}
-
- {$S ARes}
- FUNCTION TFieldsMethodItem.GetTheImplDeclaration: str255; OVERRIDE;
-
- BEGIN
- GetTheImplDeclaration:= fTextHandler.GetImplFieldsMethodDecStr(SELF);
- END; {TFieldsMethodItem.GetTheImplDeclaration}
-
- {$S ARes}
- PROCEDURE TFieldsMethodItem.WriteImplementation(theTEView: TMyTEView); OVERRIDE;
-
- VAR
- aList: TMyList;
-
- PROCEDURE WriteTheLine(theFieldItem: TFieldItem);
-
- VAR
- theCodeLine: str255;
-
- BEGIN
- theTEView.WriteToMyTEView(fTextHandler.GetFieldsMethodCodeLineStr(TheFieldItem));
- END; {WriteTheLine}
-
- BEGIN
- theTEView.WriteToMyTEView(fTextHandler.GetFieldsMethodImpStr1);
- theTEView.WriteToMyTEView(SELF.GetTheImplDeclaration);
- theTEView.WriteToMyTEView(fTextHandler.GetFieldsMethodImpStr2(SELF));
-
- aList:= fCard.GetFields;
- aList.Each(WriteTheLine);
- aList:= fCard.GetCollaborators;
- aList.Each(WriteTheLine);
-
- theTEView.WriteToMyTEView(fTextHandler.GetFieldsMethodImpStr3);
- END; {TFieldsMethodItem.WriteImplementation}
-
- {$S ARes}
- FUNCTION TFieldsMethodItem.GetNumRealMethods: integer; OVERRIDE;
-
- BEGIN
- GetNumRealMethods:= 0; {don't count me, I'm not real.}
- END; {TFieldsMethodItem.GetNumRealMethods}
-
- {$S ARes}
- FUNCTION TFieldsMethodItem.ReturnBytes: LONGINT; OVERRIDE;
-
- BEGIN
- ReturnBytes:= 0;
- END; {TFieldsMethodItem.ReturnBytes}
-
- {$S ARes}
- PROCEDURE TFieldsMethodItem.ReadTheItem(aRefNum: INTEGER; theCard: TCard); OVERRIDE;
-
- BEGIN
- {do nothing}
- END; {TFieldsMethodItem.ReadTheItem}
-
- {$S ARes}
- PROCEDURE TFieldsMethodItem.WriteTheItem(aRefNum: INTEGER); OVERRIDE;
-
- BEGIN
- {do nothing}
- END; {TFieldsMethodItem.WriteTheItem}
-
- (*****************************)
- (* methods for TAccessorItem *)
- (*****************************)
- {$S ARes}
- PROCEDURE TAccessorItem.IAccessorItem(theCard: TCard; theName: str255;
- ourField: TFieldItem);
-
- BEGIN
- SELF.IMethodItem(theCard, theName, NOT kOVERRIDE);
- SELF.SetFieldReference(ourField);
- END; {TAccessorItem.IAccessorItem}
-
- {$S ARes}
- PROCEDURE TAccessorItem.SetFieldReference(theField: TFieldItem);
-
- BEGIN
- fFieldAccessed:= theField;
- END; {TAccessorItem.SetFieldReference}
-
- {$S ARes}
- FUNCTION TAccessorItem.GetFieldAccessed: TFieldItem;
-
- BEGIN
- GetFieldAccessed:=fFieldAccessed;
- END; {TAccessorItem.GetFieldAccessed}
-
- {$S ARes}
- PROCEDURE TAccessorItem.SetFunction(makeItAFunction: boolean);
-
- BEGIN
- fFunction:= makeItAFunction;
- END; {TAccessorItem.}
-
- {$S ARes}
- FUNCTION TAccessorItem.GetTheItem: str255; OVERRIDE;
-
- BEGIN
- GetTheItem:= 'ERROR IN TACCESSORITEM.GETTHEITEM';
- END; {TAccessorItem.}
-
- {$S ARes}
- FUNCTION TAccessorItem.GetTheDeclaration: str255; OVERRIDE;
-
- VAR
- theClass: TItem;
- aString: str255;
-
- BEGIN
- ProgramBreak('ERROR in TACCESSORITEM.GETTHEDECLARATION');
- END; {TAccessorItem.}
-
- {$S ARes}
- FUNCTION TAccessorItem.GetTheImplDeclaration: str255; OVERRIDE;
-
- VAR
- theClass: TItem;
- aString: str255;
-
- BEGIN
- ProgramBreak('ERROR in TACCESSORITEM.GETTHEimplDECLARATION');
- END; {TAccessorItem.GetTheImplDeclaration}
-
- {$S ARes}
- FUNCTION TAccessorItem.GetParameter: str255;
-
- BEGIN
- GetParameter:= Concat('the', SELF.GetTheName);
- END; {TAccessorItem.GetParameter}
-
- {$S ARes}
- PROCEDURE TAccessorItem.WriteImplementation(theTEView: TMyTEView); OVERRIDE;
-
- BEGIN
- theTEView.WriteToMyTEView(SELF.GetTheCodeLine);
- END; {TAccessorItem.WriteImplementation}
-
- {$S ARes}
- FUNCTION TAccessorItem.GetNumRealMethods: integer; OVERRIDE;
-
- BEGIN
- GetNumRealMethods:= 0; {don't count me, I'm not real.}
- END; {TAccessorItem.GetNumRealMethods}
-
- {$S AWriteFile}
- FUNCTION TAccessorItem.ReturnBytes: LONGINT; OVERRIDE;
-
- BEGIN
- ReturnBytes:= 0;
- END; {TItem.ReturnBytes}
-
- {$S AReadFile}
- PROCEDURE TAccessorItem.ReadTheItem(aRefNum: INTEGER; theCard: TCard); OVERRIDE;
-
- BEGIN
- {do nothing}
- END; {TItem.ReadTheItem}
-
- {$S AWriteFile}
- PROCEDURE TAccessorItem.WriteTheItem(aRefNum: INTEGER); OVERRIDE;
-
- BEGIN
- {do nothing}
- END; {TItem.WriteTheItem}
-
- {$S AFields}
- PROCEDURE TAccessorItem.Fields(PROCEDURE DoToField(fieldName: Str255; fieldAddr: Ptr;
- fieldType: INTEGER)); OVERRIDE;
-
- BEGIN
- DoToField('TAccessorItem', NIL, bClass);
- DoToField('fFunction', @fFunction, bBoolean);
- DoToField('fFieldAccessed', @fFieldAccessed, bObject);
- INHERITED Fields(DoToField);
- END; {TMethodItem.Fields}
-
-
- (********************************)
- (* methods for TGetAccessorItem *)
- (********************************)
- {$S ARes}
- FUNCTION TGetAccessorItem.GetTheCodeLine: str255; OVERRIDE;
- BEGIN
- GetTheCodeLine:=fTextHandler.GetGetAccessorImplementation(SELF);
- END; {TGetAccessorItem.GetTheCodeLine}
-
- {$S ARes}
- FUNCTION TGetAccessorItem.GetTheItem: str255; OVERRIDE;
-
- BEGIN
- GetTheItem:= Concat(kGetAccessorPrefix, SELF.GetTheName);
- END; {TGetAccessorItem.GetTheItem}
-
- {$S ARes}
- FUNCTION TGetAccessorItem.GetTheDeclaration: str255; OVERRIDE;
-
- BEGIN
- GetTheDeclaration:= fTextHandler.GetGetAccessorStr(SELF)
- END; {TGetAccessorItem.GetTheDeclaration}
-
- {$S ARes}
- FUNCTION TGetAccessorItem.GetTheImplDeclaration: str255; OVERRIDE;
-
- BEGIN
- GetTheImplDeclaration:= fTextHandler.GetImplGetAccessorStr(SELF);
- END; {TGetAccessorItem.GetTheImplDeclaration}
-
- {$S ARes}
- PROCEDURE TGetAccessorItem.WriteInlineProcedures(theTEView: TMyTEView); OVERRIDE;
-
- BEGIN
- theTEView.WriteToMyTEView(fTextHandler.GetInlineGetAccessorStr(SELF));
- END;
-
- PROCEDURE TGetAccessorItem.CheckForPrefix; OVERRIDE;
-
- VAR
- currentPrefix: Str255;
- prefixLength : Integer;
-
- BEGIN
- prefixLength:=length(kGetAccessorPrefix);
- if length(fName) > prefixLength THEN
- BEGIN
- currentPrefix:= Copy(fName, 1, prefixLength);
- IF (currentPrefix = kGetAccessorPrefix) THEN
- Delete(fName, 1, prefixLength);
- END;
- END; {TGetAccessorItem.CheckForPrefix}
-
- {$S AClose}
- PROCEDURE TGetAccessorItem.Free; OVERRIDE;
-
- BEGIN
- fFieldAccessed.MakeGetNIL;
- INHERITED Free;
- END; {TGetAccessorItem.Free}
-
-
- (***********************************)
- (* methods for TSetAccessorItem *)
- (***********************************)
- {$S ARes}
- FUNCTION TSetAccessorItem.GetTheCodeLine: str255; OVERRIDE;
- BEGIN
- GetTheCodeLine:=fTextHandler.GetSetAccessorImplementation(SELF);
- END; {TSetAccessorItem.GetTheCodeLine}
-
- {$S ARes}
- FUNCTION TSetAccessorItem.GetTheItem: str255; OVERRIDE;
-
- BEGIN
- GetTheItem:= Concat(kSetAccessorPrefix, SELF.GetTheName);
- END; {TSetAccessorItem.GetTheItem}
-
- {$S ARes}
- FUNCTION TSetAccessorItem.GetTheDeclaration: str255; OVERRIDE;
-
- BEGIN
- GetTheDeclaration:= fTextHandler.GetSetAccessorStr(SELF);
- END; {TSetAccessorItem.GetTheDeclaration}
-
- {$S ARes}
- FUNCTION TSetAccessorItem.GetTheImplDeclaration: str255; OVERRIDE;
-
- BEGIN
- GetTheImplDeclaration:= fTextHandler.GetImplSetAccessorStr(SELF);
- END; {TSetAccessorItem.GetTheImplDeclaration}
-
- {$S ARes}
- PROCEDURE TSetAccessorItem.WriteInlineProcedures(theTEView: TMyTEView); OVERRIDE;
-
- BEGIN
- theTEView.WriteToMyTEView(fTextHandler.GetInlineSetAccessorStr(SELF));
- END;
-
- {$S ARes}
- PROCEDURE TSetAccessorItem.CheckForPrefix; OVERRIDE;
-
- VAR
- currentPrefix,
- nextLetter: str255;
- prefixLength : Integer;
-
- BEGIN
- prefixLength:=length(kSetAccessorPrefix);
- if length(fName) > prefixLength THEN
- BEGIN
- currentPrefix:= Copy(fName, 1, prefixLength);
- IF (currentPrefix = kSetAccessorPrefix) THEN
- Delete(fName, 1, prefixLength);
- END;
- END; {TSetAccessorItem.CheckForPrefix}
-
- {$S AClose}
- PROCEDURE TSetAccessorItem.Free; OVERRIDE;
-
- BEGIN
- fFieldAccessed.MakeSetNIL;
- INHERITED Free;
- END; {TSetAccessorItem.Free}
-
-
- (***********************************)
- (* methods for TCollaboratorItem *)
- (***********************************)
- {$S ARes}
- PROCEDURE TCollaboratorItem.ICollaboratorItem(theCard: TCard; theName: str255);
-
- VAR
- ourTypeStr: str255;
-
- BEGIN
- SELF.IFieldItem(theCard, theName, kEmptyString);
- ourTypeStr:= SELF.GetTheItem;
- SELF.SetItemType(ourTypeStr);
- END; {TCollaboratorItem.ICollaboratorItem}
-
- {$S ARes}
- PROCEDURE TCollaboratorItem.CheckForPrefix; OVERRIDE;
-
- VAR
- currentPrefix,
- nextLetter: str255;
-
- BEGIN
- currentPrefix:= Copy(fName, 1, 1);
- IF (currentPrefix = kClassPrefix) THEN
- BEGIN
- nextLetter:= Copy(fName, 2, 1);
- IF (nextLetter >= 'A') AND (nextLetter <= 'Z') THEN
- Delete(fName, 1, 1);
- END;
- END; {TCollaboratorItem.CheckForPrefix}
-
- {$S ARes}
- FUNCTION TCollaboratorItem.GetTheItem: str255; OVERRIDE;
-
- BEGIN
- GetTheItem:= Concat(kClassPrefix, SELF.fName);
- END; {TCollaboratorItem.GetTheItem}
-
- {$S ARes}
- FUNCTION TCollaboratorItem.GetTheFieldStr: str255;
-
- BEGIN
- GetTheFieldStr:= Concat(kFieldPrefix, SELF.fName);
- END; {TCollaboratorItem.GetTheFieldStr}
-
- {$S ARes}
- PROCEDURE TCollaboratorItem.SetTheFieldsTypeConst; OVERRIDE;
-
- BEGIN
- fFieldsTypeConst:= 'bObject';
- END; {TCollaboratorItem.SetTheFieldsTypeConst}
-
- {$S ARes}
- FUNCTION TCollaboratorItem.GetTheDeclaration: str255; OVERRIDE;
-
- BEGIN
- GetTheDeclaration:= fTextHandler.GetCollaboratorDeclaration(SELF);
- END; {TCollaboratorItem.GetTheDeclaration}
-
- {$S ARes}
- FUNCTION TCollaboratorItem.GetTheImplDeclaration: str255; OVERRIDE;
-
- BEGIN
- GetTheImplDeclaration:= fTextHandler.GetImplCollaboratorDeclaration(SELF);
- END; {TCollaboratorItem.GetTheImplDeclaration}
-
- {$S AWriteFile}
- FUNCTION TCollaboratorItem.ReturnBytes: LONGINT; OVERRIDE;
-
- BEGIN
- ReturnBytes:= kStringSize;
- END; {TCollaboratorItem.ReturnBytes}
-
- {$S AReadFile}
- PROCEDURE TCollaboratorItem.ReadTheItem(aRefNum: INTEGER; theCard: TCard); OVERRIDE;
-
- VAR
- theName: str255;
- itemSize: LONGINT;
-
- BEGIN
- itemSize:= kStringSize;
- FailOSErr(FSRead(aRefNum, ItemSize, @theName));
- SELF.ICollaboratorItem(theCard, theName);
- END; {TCollaboratorItem.ReadTheItem}
-
- {$S AWriteFile}
- PROCEDURE TCollaboratorItem.WriteTheItem(aRefNum: INTEGER); OVERRIDE;
-
- VAR
- itemSize: LONGINT;
- theString: str255;
-
- BEGIN
- itemSize:= kStringSize;
- theString:= SELF.GetTheName;
- FailOSErr(FSWrite(aRefNum, itemSize, @theString));
- END; {TCollaboratorItem.WriteTheItem}
-
-
-